package edu.zut.cs.software.module.commodity.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import edu.zut.cs.software.teach.Base.domain.BaseEntity;
@Entity
@Table(name="T_Commodity")
public class Commodity extends BaseEntity<Long>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2411978175041541798L;
	/**
	 * 商品名称
	 */
	@Column
	String name;
	
	/**
	 * 商品价格
	 */
	@Column
	int price;
	/**
	 * 商品库存
	 */
	@Column
	int inventory;
	@ManyToOne
	@JoinColumn(name = "T_CommodityCategory_ID")
	CommodityCategory commoditycategory;
	
	public CommodityCategory getCommoditycategory() {
		return commoditycategory;
	}
	public void setCommodityCategory(CommodityCategory commoditycategory) {
		this.commoditycategory = commoditycategory;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	
	
	public int getPrice() {
		return price;
	}
	public void setPrice(int price) {
		this.price = price;
	}
	public int getInventory() {
		return inventory;
	}
	public void setInventory(int inventory) {
		this.inventory = inventory;
	}
//	public void commodity() {
//	}
//	public void commodity(String name,Long id,int price,int inventory) {
//		this.name=name;
//		this.id=id;
//		this.price=price;
//		this.inventory=inventory;
//	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	
	}
	
	

}